package com.breakfast.fun.data.entity.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * 分类套餐
 * Created by Administrator on 2016/8/18.
 */
public class ProductClasses implements Serializable {

    /**
     * id : 14
     * classId : 14
     * classImage : http://m.52letsgo.cn/product_image/6/9/d6f3f25f-9_-1878436415.jpg
     * sellcount : 88
     * closetime : 22:00:00
     * classOrder : 0
     * className : 奥运套餐
     * detailImage : http://m.52letsgo.cn/product_image/6/0/28139ae9-b_843194638.jpg
     * categoryImage : http://m.52letsgo.cn/product_image/8/12/b1a21f16-5_1911331100.jpg    首页分类小图标
     */

    private int id;
    private int classId;
    private String classImage;
    private int sellcount;
    private String closetime;
    private int classOrder;
    private String className;
    private String detailImage;
    private String categoryImage;
    private int type; //0:普通  1:逼格

    public static ProductClasses objectFromData(String str) {

        return new Gson().fromJson(str, ProductClasses.class);
    }

    public static List<ProductClasses> arrayProductClassesFromData(String str) {

        Type listType = new TypeToken<ArrayList<ProductClasses>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getClassId() {
        return classId;
    }

    public void setClassId(int classId) {
        this.classId = classId;
    }

    public String getClassImage() {
        return classImage;
    }

    public void setClassImage(String classImage) {
        this.classImage = classImage;
    }

    public int getSellcount() {
        return sellcount;
    }

    public void setSellcount(int sellcount) {
        this.sellcount = sellcount;
    }

    public String getClosetime() {
        return closetime;
    }

    public void setClosetime(String closetime) {
        this.closetime = closetime;
    }

    public int getClassOrder() {
        return classOrder;
    }

    public void setClassOrder(int classOrder) {
        this.classOrder = classOrder;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getDetailImage() {
        return detailImage;
    }

    public void setDetailImage(String detailImage) {
        this.detailImage = detailImage;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getCategoryImage() {
        return categoryImage;
    }

    public void setCategoryImage(String categoryImage) {
        this.categoryImage = categoryImage;
    }

    @Override
    public String toString() {
        return "ProductClasses{" +
                "id=" + id +
                ", classId=" + classId +
                ", classImage='" + classImage + '\'' +
                ", sellcount=" + sellcount +
                ", closetime='" + closetime + '\'' +
                ", classOrder=" + classOrder +
                ", className='" + className + '\'' +
                ", detailImage='" + detailImage + '\'' +
                ", categoryImage='" + categoryImage + '\'' +
                ", type=" + type +
                '}';
    }
}
